# -*- coding: utf-8 -*-
'''
@Time    : 2023/3/8 11:17
@Author  : wzp
@File    : teambot.py

'''
import os
import requests

webhook_key="##"


def send_verification_code(msg):
    if not webhook_key :
        print("should give webhook key from teambot. exit..")
        os.exit(1)
    url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={}".format(webhook_key)
    headers = {"Content-Type": "application/json"}
    data = {
        "msgtype": "text",
        "text": {
            "content": msg
        }
    }

    response = requests.post(url, headers=headers, json=data)
    print(response.text)


if __name__ == "__main__":
    send_verification_code("中文测试")
